package ss;

import java.util.List;

import 学生选课系统2.Course;
import 学生选课系统2.Student;
import 学生选课系统2.Teacher;

public class Main {
	public static void main(String[] args) {
		Teacher teacher1 = new Teacher("王老师", 001, "男");
		Teacher teacher2 = new Teacher("张老师", 002, "女");

		// 王老师添加 课程1和课程2
		Course course1 = teacher1.addCourse(1, "C语言", "A101", "8:00");
		Course course2 = teacher1.addCourse(2, "JAVA", "A102", "10:00");

		// 张老师添加 课程3
		Course course3 = teacher2.addCourse(3, "HTML", "A101", "14:00");

		// 实例化 学生1和学生2
		Student student1 = new Student("小李", 20201001, "男");
		Student student2 = new Student("小华", 20201002, "女");

		// 学生1选课 课程1和课程2
		student1.selectCourse(course1);
		student1.selectCourse(course2);
		student2.selectCourse(course3);

		List<Course> courseList1 = student1.getCourseList();
		System.out.println("学生1【选课】【课程1和课程2】课程信息:");
		for (int i = 0; i < courseList1.size(); i++) {
			Course course = courseList1.get(i);
			System.out.println(
					(i + 1) + ".课程名称:" + course.getClassname() + ",教室：" + course.getSpot() + ",时间：" + course.getTime());
		}

		List<Course> courseList2 = student2.getCourseList();
		System.out.println("学生2【选课】【课程3】课程信息:");
		for (int i = 0; i < courseList2.size(); i++) {
			Course course = courseList2.get(i);
			System.out.println("课程名称:" + course.getClassname() + ",教室：" + course.getSpot() + ",时间：" + course.getTime());
		}

		// 学生1退课 课程1
		student1.unSelectCourse(course1);
		System.out.println("学生1【退课】【课程1】后课程信息:");
		for (int i = 0; i < courseList1.size(); i++) {
			System.out.println(courseList1.get(i).getClassname());
		}

	}
}
